//
//  HYInfoTableView.m
//  HaiYue
//
//  Created by skyline on 2018/2/5.
//  Copyright © 2018年 skyline. All rights reserved.
//

#import "HYInfoFloorTableView.h"
#import "HYInfoFloorCell.h"
@interface HYInfoFloorTableView ()<UITableViewDelegate,UITableViewDataSource>

@end
@implementation HYInfoFloorTableView
- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style
{
    self = [super initWithFrame:frame style:style];
    if (self)
    {
        self.delegate = self;
        self.dataSource = self;
    }
    return self;
}

#pragma mark - UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 10;
}
CGFloat height;
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSString *identifier = @"HYInfoCell";
    HYInfoFloorCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
    if (!cell)
    {
        cell = [[HYInfoFloorCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];
    }
    NSString *imagename = [NSString stringWithFormat:@"%ld",(indexPath.row%5)];
    cell.dict = @{@"title":@"今日开测!3D狩猎手游《猎魂觉醒》重剑武器视频首曝-20",
                  @"imageName":imagename,
                  @"icon":@"2",
                  @"author":@"天际游戏",
                  @"time":@"2017-12-13 09:47:15",
                  @"content":@"该卖家很懒，未填写任何描述，请以截图为准，该卖家很懒，未填写任何描述，请以截图为准，该卖家很懒，未填写任何描述该卖家很懒，未填写任何描述，请以截图为准，该卖家很懒，未填写任何描述，请以截图为准，该卖家很懒，未填写任何描述该卖家很懒，未填写任何描述，请以截图为准，该卖家很懒，未填写任何描述，请以截图为准，该卖家很懒，未填写任何描述该卖家很懒，未填写任何描述，请以截图为准，该卖家很懒，未填写任何描述，请以截图为准，该卖家很懒，未填写任何描述该卖家很懒，未填写任何描述，请以截图为准，该卖家很懒，未填写任何描述，请以截图为准，该卖家很懒，未填写任何描述",
                  };
    height = CGRectGetHeight(cell.bounds);
    return cell;
}
#pragma mark - UITableViewDelegate
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    
    return height;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    if (self.hydelegate && [self.hydelegate respondsToSelector:@selector(tableView: didSelectRowAtIndexPath:)])
    {
        [self.hydelegate tableView:tableView didSelectRowAtIndexPath:indexPath];
    }
}

/*
 // Only override drawRect: if you perform custom drawing.
 // An empty implementation adversely affects performance during animation.
 - (void)drawRect:(CGRect)rect {
 // Drawing code
 }
 */

@end
